home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / windows / utils / wininkit.arj / WININST.BAT < prev    next >
DOS Batch File  |  1993-08-26  |  4KB  |  127 lines

  1. @echo off
  2. cls
  3. if "%1==" goto instruct
  4. if "%2==" goto instruct
  5. if "%3==" goto instruct
  6. if not exist %1 goto instruct
  7.  
  8. echo *─» %1
  9. echo You are about to run the above program as a Windows 3.1 installation program.
  10. echo:
  11. echo Before you being, please make sure the following programs are in your path:
  12. echo      ATTRIB.EXE      - Usually in C:\DOS
  13. echo      SETPROG.EXE  \
  14. echo      C_NEW.EXE      - Part of the Windows Installation Kit.
  15. echo      CHECKDIR.EXE /
  16. echo:
  17. echo Please exit Windows as soon as the installation is completed.  If you are given
  18. echo a choice between Re-Starting and Exiting Windows you should choose Exit.
  19. echo:
  20. echo Your default shell will be changed to PROGMAN.EXE, and the startup group will
  21. echo be disabled.  This is done for 2 reasons:
  22. echo      1. Some installation programs require PROGMAN.
  23. echo      2. With the Startup Group disabled, there is less of a chance of a
  24. echo         confilict with another program.
  25. echo Both your default shell and the Startup Group will be restored as soon as you
  26. echo exit Windows.
  27. echo:
  28. echo NOTE:  This program requires DOS 5 or higher.
  29. echo ───────────────────────────────────────────────────────────────────────────────
  30. pause
  31. cls
  32.  
  33. echo Checking directory, please wait...
  34. CheckDir %3 C Q
  35. If Not ErrorLevel==0 GoTo End
  36.  
  37. :Windows
  38. echo Taking a "Snapshot" of your Windows directory...
  39. cd\windows
  40. copy *.ini *.org >>nul
  41. attrib -a *.* /s >>nul
  42. dir *.grp /b >%3\%2.gnf
  43.  
  44. setprog S
  45. If NOT ErrorLevel==0 GoTo End
  46.  
  47. echo Starting Windows...
  48. Call win %1
  49. ask Was the application installed successfully?
  50. if errorlevel==0 goto END
  51.  
  52. cd\windows
  53. setprog R
  54. If NOT ErrorLevel==0 GoTo End
  55. Rem  SYSTEM.INI will show up as a changed file, even if nothing was done to it.
  56.  
  57. cls
  58. echo Obtaining information on changed files...
  59. attrib -a *.grp /s >>nul
  60. dir *.*   /a:a /b /s          >%3\%2.prg
  61. dir *.ini /a:a /b /s          >%3\%2.nfo
  62.  
  63. echo:
  64. echo Analizing changed data...
  65. c_new %2 %3
  66. If NOT ErrorLevel==0 GoTo End
  67.  
  68. echo:
  69. echo Cleaning up old files...
  70. del c:\windows\*.org  >nul
  71. del %3\%2.gnf
  72.  
  73. :Complete
  74. echo Complete!
  75. echo Destination Directory: %3
  76. echo Information can be found in the following files:
  77. echo       %2.PRG    - All Modified Files.
  78. echo       %2.NFO    - Modified/New .INI and .GRP Files.
  79. echo       %2.CHG    - Modifications made to existing .INI files.
  80. echo       %2.CMD    - Command file for INIMOD.EXE.
  81. echo       %2.BAT    - Batch file to install application.
  82.  
  83. goto end
  84.  
  85. :instruct
  86. echo Syntax: WININST [Install File]  [Hold File]  [Destination Directory]
  87. echo                 * Where [Install File] is the name of the installation program
  88. echo                   to execute under Windows 3.1 with the drive, path, and
  89. echo                   extension of the file.
  90. echo:
  91. echo                 * Where [Hold File] is the name of the changed output file.
  92. echo                     [Hold File].PRG will contain ALL modified/new files in
  93. echo                       C:\WINDOWS and its sub-directories.
  94. echo                     [Hold File].NFO will contain all modified/new INI & GRP
  95. echo                       files in C:\WINDOWS and its sub-directories.
  96. echo                     [Hold File].CHG will contain all modifications to the INI
  97. echo                       files in the C:\WINDOWS directory.
  98. echo:
  99. echo                 * Where [Destination Directory] is the drive and directory
  100. echo                     where the [Hold File]'s will be created, and all new files
  101. echo                     will be coppied to.  This directory will automatically be
  102. echo                     created if it does not exist.  (Ex:  F:\WININST\EXCEL.INS)
  103. if "%1==" goto end
  104. echo:
  105. echo ═══════════════════════════════════════════════════════════════════════════════
  106. echo ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
  107. if not exist %1 goto not_found
  108. if "%2==" goto no_holdfile
  109. if "%3==" goto no_destdir
  110. goto end
  111.  
  112. :not_found
  113. echo                        » Installation program not found «
  114. goto end
  115.  
  116. :no_holdfile
  117. echo                        » Hold File was not specified «
  118. goto end
  119.  
  120. :no_destdir
  121. echo                   » Destination Directory was not specified «
  122. goto end
  123.  
  124.  
  125. :end
  126. echo ────────────────────────────────────────────────────────────────────────────────
  127.